#ifndef _CAMERA_H_
#define _CAMERA_H_

#include <linux/videodev2.h>

typedef struct Cam_Config_s
{
    int width;
    int height;
    int fmt;
    int buf_num;
} Cam_Config_t;

typedef struct Cam_Buffer_s
{
    void *start;
    int length;
    int fd;
} Cam_Buffer_t;

typedef struct Cam_Device_s
{
    int fd;
    int fmt;
    int buf_num;
    Cam_Buffer_t buf[];
} Cam_Device_t;


Cam_Device_t *Camera_Init(Cam_Config_t *cfg);

void Camera_DeInit(Cam_Device_t *device);

int Camera_StreamOn(Cam_Device_t *dev);

int Camera_StreamOff(Cam_Device_t *dev);

int Cam_EnqueueBuf(Cam_Device_t *device, int index);

int Cam_DequeueBuf(Cam_Device_t *device);



#endif
